htmldiagnosis = "<p>These ports are known to your operating system, but cannot be used. \n This may be because the device is not plugged in (such as on a USB to serial cable) or because \n you don't have sufficient permissions to use them."
htmldiagnosis = '<p>This port should not be selected. If you believe it is the correct\n port, you should cause it to become available such as by plugging in the cable or ensuring\n you have correct permissions. Press refresh once you have done so and it should be listed\n under available. Note that the name may change as it becomes available.<p>' + genhtml(port)
res = '<table width="100%"><tr><th width="20%">Property<th width="40%">Value<th width="40%">Description</tr>\n'
keys = port.keys()
keys.sort()
for k in keys:
res += '<tr><td>' + sfont + k + efont + '</td><td>\n'
if k == 'active' or k == 'available':
if port[k]:
res += sfont + 'True' + efont
else:
res += sfont + 'False' + efont
elif k == 'driverdate':
res += sfont + '%d-%d-%d' % port[k] + efont
elif k == 'driverstatus':
res += sfont + `port[k]` + efont
elif isinstance(port[k], type('')):
res += sfont + port[k] + efont
else:
res += sfont + `port[k]` + efont
res += '</td><td>'
if k == 'name':
res += sfont + 'This is the name the port is known to your operating system as' + efont
elif k == 'available':
if port[k]:
res += sfont + 'It was possible to open this port' + efont
else:
res += sfont + 'It was not possible to open this port' + efont
elif k == 'active':
if port[k]:
res += sfont + 'Your operating system shows this driver and port is correctly configured and a device attached' + efont
else:
res += sfont + 'This driver/port combination is not currently running' + efont
elif k == 'driverstatus':
res += sfont + 'This is low level detail. If problem is non-zero then you need to look in the\n control panel for an explanation as to why this driver/device is not working.' + efont
elif k == 'hardwareinstance':
res += sfont + 'This is how the device is named internally. For example USB devices include\n the vendor (VID) and product (PID) identities' + efont